<?php
include "../config/koneksi.php";
//include "../config/library.php";
//include "../config/fungsi_indotgl.php";
//include "../config/fungsi_combobox.php";
include "../config/class_paging.php";

$act=$_GET['act'];
if($act=='hapus'){
	//echo "woi : ";
	mysql_query("DELETE FROM siswa WHERE nis='$_GET[nis]'");
	echo "<meta content='0;media.php?module=siswa' http-equiv='refresh' /> ";
}
	
if(isset($_POST['submit']))
{
/*
    $nama_tamu = $_POST['nama_tamu'];
    $email_tamu = $_POST['email_tamu'];
    $judul = $_POST['judul'];
    $pesan_tamu = $_POST['pesan_tamu'];
    //echo "<b> $nama_tamu </b><br>";    
    //echo "<b> $email_tamu </b><br>";    
    //echo "<b> $judul </b><br>";    
    //echo "<b> $pesan_tamu </b><br>";    
	
	$query = mysql_query("insert into buku_tamu(nama_tamu, email_tamu, judul, pesan_tamu) values ('$nama_tamu', '$email_tamu','$judul','$pesan_tamu') ");
*/
	if($act=='input'){
		//echo "nis : " . $_POST[nis] . "<br>";
		
		$query = mysql_query("insert into siswa (
		nis, nama, jenis_kelamin, agama, tempat_lahir, tanggal_lahir, berat_badan, tinggi_badan, ukuran_sepatu, ukuran_celana, ukuran_baju, alamat, rt, rw, desa, kecamatan, kota, kodepos, telp, provinsi, email, asal_sekolah, tahun_ajaran, no_skhun, nama_ayah, usia_ayah, pekerjaan_ayah, nama_ibu, usia_ibu, pekerjaan_ibu, jumlah_anak, anak_ke, penghasilan, ijazah, kelakuan_baik, skhun, keterangan_sehat, pasphoto, tidak_buta_warna) values 
		('$_POST[nis]', 
		'$_POST[nama]',
		'$_POST[jenis_kelamin]',
		'$_POST[agama]',
		'$_POST[tempat_lahir]',
		'$_POST[tanggal_lahir]',
		'$_POST[berat_badan]',
		'$_POST[tinggi_badan]',
		'$_POST[ukuran_sepatu]',
		'$_POST[ukuran_celana]',
		'$_POST[ukuran_baju]',
		'$_POST[alamat]',
		'$_POST[rt]',
		'$_POST[rw]',
		'$_POST[desa]',
		'$_POST[kecamatan]',
		'$_POST[kota]',
		'$_POST[kodepos]',
		'$_POST[telp]',
		'$_POST[provinsi]',
		'$_POST[email]',
		'$_POST[asal_sekolah]',
		'$_POST[tahun_ajaran]',
		'$_POST[no_skhun]',
		'$_POST[nama_ayah]',
		'$_POST[usia_ayah]',
		'$_POST[pekerjaan_ayah]',
		'$_POST[nama_ibu]',
		'$_POST[usia_ibu]',
		'$_POST[pekerjaan_ibu]',
		'$_POST[jumlah_anak]',
		'$_POST[anak_ke]',
		'$_POST[penghasilan]',
		'$_POST[ijazah]',
		'$_POST[kelakuan_baik]',
		'$_POST[skhun]',
		'$_POST[keterangan_sehat]',
		'$_POST[pasphoto]',
		'$_POST[tidak_buta_warna]' ) ");
		
		//echo "nis : " . $_POST[nama] . "<br>";
		echo "<meta content='0;media.php?module=siswa' http-equiv='refresh' /> ";
	}
	
	if($act=='edit'){
		//echo "nis : " . $_POST[nis] . "<br>";
		
		mysql_query("UPDATE siswa SET nama       = '$_POST[nama]',
                                   jenis_kelamin = '$_POST[jenis_kelamin]',
                                   agama = '$_POST[agama]',
                                   tempat_lahir = '$_POST[tempat_lahir]',
                                   tanggal_lahir = '$_POST[tanggal_lahir]',
                                   berat_badan = '$_POST[berat_badan]',
                                   tinggi_badan = '$_POST[tinggi_badan]',
                                   ukuran_sepatu = '$_POST[ukuran_sepatu]',
                                   ukuran_celana = '$_POST[ukuran_celana]',
                                   ukuran_baju = '$_POST[ukuran_baju]',
                                   alamat = '$_POST[alamat]',
                                   rt = '$_POST[rt]',
                                   rw = '$_POST[rw]',
                                   desa = '$_POST[desa]',
                                   kecamatan = '$_POST[kecamatan]',
                                   kota = '$_POST[kota]',
                                   kodepos = '$_POST[kodepos]',
                                   telp = '$_POST[telp]',
                                   provinsi = '$_POST[provinsi]',
                                   email = '$_POST[email]',
                                   asal_sekolah = '$_POST[asal_sekolah]',
                                   tahun_ajaran = '$_POST[tahun_ajaran]',
                                   no_skhun = '$_POST[no_skhun]',
                                   nama_ayah = '$_POST[nama_ayah]',
                                   usia_ayah = '$_POST[usia_ayah]',
                                   pekerjaan_ayah = '$_POST[pekerjaan_ayah]',
                                   nama_ibu = '$_POST[nama_ibu]',
                                   usia_ibu = '$_POST[usia_ibu]',
                                   pekerjaan_ibu = '$_POST[pekerjaan_ibu]',
                                   jumlah_anak = '$_POST[jumlah_anak]',
                                   anak_ke = '$_POST[anak_ke]',
                                   penghasilan = '$_POST[penghasilan]',
                                   ijazah = '$_POST[ijazah]',
                                   kelakuan_baik = '$_POST[kelakuan_baik]',
                                   skhun = '$_POST[skhun]',
                                   keterangan_sehat = '$_POST[keterangan_sehat]',
                                   pasphoto = '$_POST[pasphoto]',
                                   tidak_buta_warna = '$_POST[tidak_buta_warna]'
                             WHERE nis   = '$_POST[nis]'");
		
		//echo "nis : " . $_POST[nama] . "<br>";
		echo "<meta content='0;media.php?module=siswa' http-equiv='refresh' /> ";
	}
	
	
}
?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SMK Pasundan Rancaekek</title>

<link href="../css/templatemo_style.css" rel="stylesheet" type="text/css" />

<link rel="stylesheet" type="text/css" href="../css/ddsmoothmenu.css" />
<script type="text/javascript" src="../scripts/jquery.min.js"></script>
<script type="text/javascript" src="../scripts/ddsmoothmenu.js">

</script>

<script type="text/javascript">

ddsmoothmenu.init({
	mainmenuid: "templatemo_menu", //menu DIV id
	orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
	classname: 'ddsmoothmenu', //class added to menu's outer DIV
	//customtheme: ["#1c5a80", "#18374a"],
	contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})

</script>
</head>

<body id="subpage">

<div id="templatemo_outer_sub_wrapper">
	<div id="templatemo_sub_wrapper">
    
    	<div id="templatemo_header_admin">		
            <?php
			include "menu_admin.php";
			?>
            <div class="cleaner"></div>

        </div> <!-- end of templatemo header -->
        
        <div id="templatemo_main">
        
          	<div class="col_w960 col_w960_last">
				<div class="col_w300 float_r">
                
                    <h3>Tentang Sekolah</h3>
                    <?php 
					include "menu_kiri.php";
					?>
                
                </div>  
                <div class="col_w600 float_l">
                    
                    <h2>Data Siswa</h2>
        		<input type=button value='Data Siswa' onclick="window.location.href='?module=siswa'">
        		<input type=button value='Tambah Siswa' onclick="window.location.href='?module=siswa&act=tambahsiswa'">
				
        		<div id="contact_form">
				<?php
				switch($_GET[act]){
				default:
					echo "
          <form method=get action='$_SERVER[PHP_SELF]'>
          <input type=hidden name=module value=siswa>
          <div id=paging>Masukkan Nama Siswa : <input type=text name='nama'> <input type=submit value=Cari></div>
          </form>";

    if (empty($_GET['nama'])){
    echo "<table class='ijo'>  
          <tr id='ijo'><th>No</th><th>nis</th><th>Nama</th><th>Kelas</th><th></th></tr>";

    $p      = new Paging;
    $batas  = 15;
    $posisi = $p->cariPosisi($batas);
    
    $tampil = mysql_query("SELECT * from siswa ORDER BY nis ASC LIMIT $posisi,$batas");
    
  
    $no = $posisi+1;
    while($r=mysql_fetch_array($tampil)){     
	$tampil2 = mysql_query("SELECT k.kelas from siswa_kelas sk, kelas k WHERE sk.nis=$r[nis] AND k.kd_kelas=sk.kd_kelas");
	$r2=mysql_fetch_array($tampil2);
      echo "<tr><td>$no</td>
                <td>$r[nis]</td>
                <td>$r[nama]</td>
                <td>$r2[kelas]</td>
		            <td><a href=?module=siswa&act=editsiswa&nis=$r[nis]>Edit</a> | 
		                <a href='$aksi?module=siswa&act=hapus&nis=$r[nis]' onClick=\"return confirm('Anda yakin akan menghapus $r[nama]?')\">Hapus</a></td>
		        </tr>";
      $no++;
    }
    echo "</table>";

    $jmldata = mysql_num_rows(mysql_query("SELECT * FROM siswa"));
      
    $jmlhalaman  = $p->jumlahHalaman($jmldata, $batas);
    $linkHalaman = $p->navHalaman($_GET[halaman], $jmlhalaman);

    echo "<div id=paging>$linkHalaman</div><br>";
 
    break;    
    }
    else{
    echo "<table>  
          <tr><th>No</th><th>nis</th><th>Nama</th><th>Kelas</th><th>aksi</th></tr>";

    $p      = new Paging9;
    $batas  = 15;
    $posisi = $p->cariPosisi($batas);

    $tampil = mysql_query("SELECT * FROM siswa WHERE nama LIKE '%$_GET[nama]%' ORDER BY nis ASC LIMIT $posisi,$batas");
      
    $no = $posisi+1;
    while($r=mysql_fetch_array($tampil)){
		$tampil2 = mysql_query("SELECT k.kelas from siswa_kelas sk, kelas k WHERE sk.nis=$r[nis] AND k.kd_kelas=sk.kd_kelas");
		$r2=mysql_fetch_array($tampil2);
      echo "<tr><td>$no</td>
                <td>$r[nis]</td>
                <td>$r[nama]</td>
                <td>$r2[kelas]</td>               
		            <td><a href=?module=siswa&act=editsiswa&nis=$r[nis]>Edit</a> | 
		                <a href='$aksi?module=siswa&act=hapus&nis=$r[nis]'>Hapus</a></td>
		        </tr>";
      $no++;
    }
    echo "</table>";

    $jmldata = mysql_num_rows(mysql_query("SELECT * FROM siswa WHERE nama LIKE '%$_GET[nama]%'"));
    
    $jmlhalaman  = $p->jumlahHalaman($jmldata, $batas);
    $linkHalaman = $p->navHalaman($_GET[halaman], $jmlhalaman);

    echo "<div id=paging>$linkHalaman</div><br>";
 
    break;    
    }
					break;
				case "tambahsiswa":
					?>
					<form method="post" name="contact" action="<?php echo $_SERVER['PHP_SELF']; ?>?module=siswa&act=input">
                        
						
						<table class='putih' border="0" width="650">
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>DATA DIRI</strong></li>
						</ul>
						</td>
						</tr>
						<tr>
						<td>NIS</td> <td colspan="3"> <input type="text" name="nis" size="10" /> </td>                        
						</tr>
						<tr>
						<td>Nama Lengkap </td> <td colspan="3"> <input type="text" name="nama" size="30" /> </td>                        
						</tr>
						
						<tr>
						<td>Jenis Kelamin </td> <td colspan="3">
						<input type=radio name='jenis_kelamin' value='L' checked>Laki-Laki 
                        <input type=radio name='jenis_kelamin' value='P'> Perempuan
						</td>                        
						</tr>
						
						<tr>
						<td>Agama </td> <td colspan="3">
						<select name='agama'>								
							<?php
							$tampil=mysql_query("SELECT * FROM agama");
							while($r=mysql_fetch_array($tampil)){
								echo "<option value=$r[id_agama]>$r[nama_agama]</option>";
							}
							?>
						</select>
						</td>                        
						</tr>
						
						<tr>
						<td>Tempat Lahir </td> <td colspan="3"> <input type="text" name="tempat_lahir" size="20" /> </td>                        
						</tr>
						
						<tr>
						<td>Tgl Lahir </td> <td colspan="3"> <input type="text" name="tanggal_lahir" size="20" /> </td>                        
						</tr>
                        
						<tr>
						<td valign="top">Data Fisik</td> <td colspan="3" width="700">
						Berat Badan <input type="text" name="berat_badan" size="2" /> Kg
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Tinggi Badan <input type="text" name="tinggi_badan" size="2" /> Cm <br>
						Ukuran Sepatu <input type="text" name="ukuran_sepatu" size="2" /> 
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Ukuran Celana <input type="text" name="ukuran_celana" size="2" /> 
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Ukuran Baju 
						<select name='ukuran_baju'>								
							<option value='S']>S</option>
							<option value='M']>M</option>
							<option value='L']>L</option>
						</select>
						</td>                        
						</tr>
                        
						<tr>
						<td>Alamat </td> <td colspan="3"><input type="text" name="alamat" size="60" /> </td>                        
						</tr>
						<tr>
						<td> </td> <td colspan="3">
						RT <input type="text" name="rt" size="1" /> 
						RW <input type="text" name="rw" size="1" /> <br/>
						Desa <input type="text" name="desa" size="40" /> <br/>
						Kecamatan <input type="text" name="kecamatan" size="40" /> <br/>
						Kota/Kabupaten <input type="text" name="kota" size="40" /> <br/>
						Kodepos <input type="text" name="kodepos" size="5" /> 
						Telp <input type="text" name="telp" size="15" /> <br/>
						Provinsi <input type="text" name="provinsi" size="20" /> <br/>
						Email <input type="text" name="email" size="30" /> <br/>
						
						</td>                        
						</tr>
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>PENDIDIKAN</strong></li>
						</ul>
						</td>
						<tr> <td>Sekolah Asal </td> <td colspan="3"><input type="text" name="asal_sekolah" size="50" /> </td> </tr>
						<tr> <td>
						Tahun Masuk </td> <td colspan="3"><input type="text" name="tahun_ajaran" size="5" /> 
						&nbsp;&nbsp;&nbsp;&nbsp;
						c. No. SKHUN <input type="text" name="no_skhun" size="20" /> 
						
						</td> </tr>
						</tr>
						
						
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>DATA ORANG TUA</strong></li>
						</ul>
						</td>
						</tr>
						<tr> <td>Nama Ayah </td> <td colspan="3"><input type="text" name="nama_ayah" size="40" /> </td> </tr>
						<tr> <td>Usia</td> <td colspan="3"><input type="text" name="usia_ayah" size="5" /> tahun</td> </tr>
						<tr> <td>Pekerjaan</td> <td colspan="3"><input type="text" name="pekerjaan_ayah" size="30" /></td> </tr>
						<tr> <td>Nama Ibu </td> <td colspan="3"><input type="text" name="nama_ibu" size="40" /> </td> </tr>
						<tr> <td>Usia</td> <td colspan="3"><input type="text" name="usia_ibu" size="5" /> tahun</td> </tr>
						<tr> <td>Pekerjaan</td> <td colspan="3"><input type="text" name="pekerjaan_ibu" size="30" /></td> </tr>
						<tr> <td>Jumlah Anak</td> <td><input type="text" name="jumlah_anak" size="5" /> orang </td> 
						<td colspan="3"> anak ke <input type="text" name="anak_ke" size="5" /></td> 
						</tr>
						<tr>
						
						</tr>
						<td colspan="4">
						Rata-rata penghasilan pendapatan /bulan (ayah dan ibu)
						<select name='penghasilan'>								
							<option value='1']>&ge; Rp 2 juta/bulan</option>
							<option value='2']>Rp 1 juta s/d 2 juta/bulan</option>
							<option value='3']>&le; Rp 1 juta/bulan</option>
						</select>
						</td>
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>KELENGKAPAN</strong></li>
						</ul>
						</td>
						</tr>
						<tr>
						<td width="200"> a. Photo copy ijazah (dilegalisir) </td> <td><input type="text" name="ijazah" size="5" /> </td>
						<td> d. Surat kelakuan baik dari Sekolah </td> <td><input type="text" name="kelakuan_baik" size="5" /> </td>
						</tr>
						
						<tr>
						<td width="200"> b. Photo copy SKHUN (dilegalisir) </td> <td><input type="text" name="skhun" size="5" /> </td>
						<td> e. Surat keterangan sehat </td> <td><input type="text" name="keterangan_sehat" size="5" /> </td>
						</tr>
						
						<tr>
						<td width="200"> c. Pas Photo 2x3, 3x4, 4x6 2 lmbr </td> <td><input type="text" name="pasphoto" size="5" /> </td>
						<td> f. Surat keterangan tidak buta warna </td> <td><input type="text" name="tidak_buta_warna" size="5" /> </td>
						</tr>
						
						<tr>
						<td>						
						</td>
						<td colspan="3">				
                        <input type="submit" value="Send" id="submit" name="submit" class="submit_btn float_l" />
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="reset" value="Reset" id="reset" name="reset" class="submit_btn float_l" />
						</td>						
						</tr>
						</table>						
                    </form>
					<?php
					break;
					
				case "editsiswa":
				$edit = mysql_query("SELECT * FROM siswa WHERE nis='$_GET[nis]' ");
				$r    = mysql_fetch_array($edit);
					?>
					<form method="post" name="contact" action="<?php echo $_SERVER['PHP_SELF']; ?>?module=siswa&act=edit">
                        
						<table class='putih' border="0" width="650">
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>DATA DIRI</strong></li>
						</ul>
						</td>
						</tr>
						<tr>
						<td>NIS</td> <td colspan="3"> <input type="text" readonly name="nis" size="10" value="<?php echo $r[nis]; ?>" /> </td>                        
						</tr>
						<tr>
						<td>Nama Lengkap </td> <td colspan="3"> <input type="text" name="nama" size="30" value="<?php echo $r[nama]; ?>"/> </td>                        
						</tr>
						
						<tr>
						<td>Jenis Kelamin </td> <td colspan="3">
						<?php
						if ($r[jenis_kelamin]=='L'){
							echo "<input type=radio name='jenis_kelamin' value='L' checked>Laki-Laki ";
							echo "<input type=radio name='jenis_kelamin' value='P'> Perempuan ";
						}else{
							echo "<input type=radio name='jenis_kelamin' value='L'>Laki-Laki ";
							echo "<input type=radio name='jenis_kelamin' value='P' checked>Perempuan ";
						}
						?>
						</td>                        
						</tr>
						
						<tr>
						<td>Agama </td> <td colspan="3">
						<?php
						echo "
						<select name='agama'>"; 
							  $tampil=mysql_query("SELECT * FROM agama");
							  while($w=mysql_fetch_array($tampil)){
								if ($r[agama]==$w[id_agama]){
								  echo "<option value=$w[id_agama] selected>$w[nama_agama]</option>";
								}
								else{
								  echo "<option value=$w[id_agama]>$w[nama_agama]</option>";
								}
							  }

						echo "</select>";
						?>
						</td>                        
						</tr>
						
						<tr>
						<td>Tempat Lahir </td> <td colspan="3"> <input type="text" name="tempat_lahir" size="20" value="<?php echo $r[tempat_lahir]; ?>"/> </td>                        
						</tr>
						
						<tr>
						<td>Tgl Lahir </td> <td colspan="3"> <input type="text" name="tanggal_lahir" size="20" value="<?php echo $r[tanggal_lahir]; ?>" /> </td>                        
						</tr>
                        
						<tr>
						<td valign="top">Data Fisik</td> <td colspan="3" width="700">
						Berat Badan <input type="text" name="berat_badan" size="2" value="<?php echo $r[berat_badan]; ?>" /> Kg
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Tinggi Badan <input type="text" name="tinggi_badan" size="2" value="<?php echo $r[tinggi_badan]; ?>"/> Cm <br>
						Ukuran Sepatu <input type="text" name="ukuran_sepatu" size="2" value="<?php echo $r[ukuran_sepatu]; ?>"/> 
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Ukuran Celana <input type="text" name="ukuran_celana" size="2" value="<?php echo $r[ukuran_celana]; ?>"/> 
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
						Ukuran Baju 						
						<?php
						
						echo "
						<select name='ukuran_baju'>";
						if ($r[ukuran_baju]=='S'){
							echo "	<option value='S' selected>S</option>
									<option value='M'>M</option>
									<option value='L'>L</option>";
						}
						if ($r[ukuran_baju]=='M'){
							echo "	<option value='S'>S</option>
									<option value='M' selected>M</option>
									<option value='L'>L</option>";
						}
						if ($r[ukuran_baju]=='L'){
							echo "	<option value='S'>S</option>
									<option value='M'>M</option>
									<option value='L' selected>L</option>";
						}
						echo "</select>";
						?>
						</td>                        
						</tr>
                        
						<tr>
						<td>Alamat </td> <td colspan="3"><input type="text" name="alamat" size="60" value="<?php echo $r[alamat]; ?>"/> </td>                        
						</tr>
						<tr>
						<td> </td> <td colspan="3">
						RT <input type="text" name="rt" size="1" value="<?php echo $r[rt]; ?>"/> 
						RW <input type="text" name="rw" size="1" value="<?php echo $r[rw]; ?>"/> <br/>
						Desa <input type="text" name="desa" size="40" value="<?php echo $r[desa]; ?>" /> <br/>
						Kecamatan <input type="text" name="kecamatan" size="40" value="<?php echo $r[kecamatan]; ?>"/> <br/>
						Kota/Kabupaten <input type="text" name="kota" size="40" value="<?php echo $r[kota]; ?>"/> <br/>
						Kodepos <input type="text" name="kodepos" size="5" value="<?php echo $r[kodepos]; ?>"/> 
						Telp <input type="text" name="telp" size="15" value="<?php echo $r[telp]; ?>"/> <br/>
						Provinsi <input type="text" name="provinsi" size="20" value="<?php echo $r[provinsi]; ?>"/> <br/>
						Email <input type="text" name="email" size="30" value="<?php echo $r[email]; ?>"/> <br/>
						
						</td>                        
						</tr>
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>PENDIDIKAN</strong></li>
						</ul>
						</td>
						<tr> <td>Sekolah Asal </td> <td colspan="3"><input type="text" name="asal_sekolah" size="50" value="<?php echo $r[asal_sekolah]; ?>"/> </td> </tr>
						<tr> <td>
						Tahun Masuk </td> <td colspan="3"><input type="text" name="tahun_ajaran" size="5" value="<?php echo $r[tahun_ajaran]; ?>"/> 
						&nbsp;&nbsp;&nbsp;&nbsp;
						c. No. SKHUN <input type="text" name="no_skhun" size="20" value="<?php echo $r[no_skhun]; ?>"/> 
						
						</td> </tr>
						</tr>
						
						
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>DATA ORANG TUA</strong></li>
						</ul>
						</td>
						</tr>
						<tr> <td>Nama Ayah </td> <td colspan="3"><input type="text" name="nama_ayah" size="40" value="<?php echo $r[nama_ayah]; ?>"/> </td> </tr>
						<tr> <td>Usia</td> <td colspan="3"><input type="text" name="usia_ayah" size="5" value="<?php echo $r[usia_ayah]; ?>" /> tahun</td> </tr>
						<tr> <td>Pekerjaan</td> <td colspan="3"><input type="text" name="pekerjaan_ayah" size="30" value="<?php echo $r[pekerjaan_ayah]; ?>"/></td> </tr>
						<tr> <td>Nama Ibu </td> <td colspan="3"><input type="text" name="nama_ibu" size="40" value="<?php echo $r[nama_ibu]; ?>"/> </td> </tr>
						<tr> <td>Usia</td> <td colspan="3"><input type="text" name="usia_ibu" size="5" value="<?php echo $r[usia_ibu]; ?>" /> tahun</td> </tr>
						<tr> <td>Pekerjaan</td> <td colspan="3"><input type="text" name="pekerjaan_ibu" size="30" value="<?php echo $r[pekerjaan_ibu]; ?>"/></td> </tr>
						<tr> <td>Jumlah Anak</td> <td><input type="text" name="jumlah_anak" size="5" value="<?php echo $r[jumlah_anak]; ?>"/> orang </td> 
						<td colspan="3"> anak ke <input type="text" name="anak_ke" size="5" value="<?php echo $r[anak_ke]; ?>"/></td> 
						</tr>
						<tr>
						
						</tr>
						<td colspan="4">
						Rata-rata penghasilan pendapatan /bulan (ayah dan ibu)
						<?php
						echo "
						<select name='penghasilan'>";
						if ($r[penghasilan]=='1'){
							echo "	<option value='1' selected>&ge; Rp 2 juta/bulan</option>
									<option value='2'>Rp 1 juta s/d 2 juta/bulan</option>
									<option value='3'>&le; Rp 1 juta/bulan</option>";
						}
						if ($r[penghasilan]=='2'){
							echo "	<option value='1'>&ge; Rp 2 juta/bulan</option>
									<option value='2' selected>Rp 1 juta s/d 2 juta/bulan</option>
									<option value='3'>&le; Rp 1 juta/bulan</option>";
						}
						if ($r[penghasilan]=='3'){
							echo "	<option value='1'>&ge; Rp 2 juta/bulan</option>
									<option value='2'>M</option>
									<option value='3' selected>&le; Rp 1 juta/bulan</option>";
						}
						echo "</select>";
						?>
						</td>
						<tr>
						<td colspan="4">
						<ul class="templatemo_list">
						<li><strong>KELENGKAPAN</strong></li>
						</ul>
						</td>
						</tr>
						<tr>
						<td width="200"> a. Photo copy ijazah (dilegalisir) </td> <td><input type="text" name="ijazah" size="5" value="<?php echo $r[ijazah]; ?>"/> </td>
						<td> d. Surat kelakuan baik dari Sekolah </td> <td><input type="text" name="kelakuan_baik" size="5" value="<?php echo $r[kelakuan_baik]; ?>"/> </td>
						</tr>
						
						<tr>
						<td width="200"> b. Photo copy SKHUN (dilegalisir) </td> <td><input type="text" name="skhun" size="5" value="<?php echo $r[skhun]; ?>"/> </td>
						<td> e. Surat keterangan sehat </td> <td><input type="text" name="keterangan_sehat" size="5" value="<?php echo $r[keterangan_sehat]; ?>" /> </td>
						</tr>
						
						<tr>
						<td width="200"> c. Pas Photo 2x3, 3x4, 4x6 2 lmbr </td> <td><input type="text" name="pasphoto" size="5" value="<?php echo $r[pasphoto]; ?>"/> </td>
						<td> f. Surat keterangan tidak buta warna </td> <td><input type="text" name="tidak_buta_warna" size="5" value="<?php echo $r[tidak_buta_warna]; ?>"/> </td>
						</tr>
						
						<tr>
						<td>						
						</td>
						<td colspan="3">				
                        <input type="submit" value="Send" id="submit" name="submit" class="submit_btn float_l" />
						&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="reset" value="Reset" id="reset" name="reset" class="submit_btn float_l" />
						</td>						
						</tr>
						</table>						
                    </form>
					<?php
					break;
					
				
				}
				?>				
        		</div>
                </div>
                
            	<div class="cleaner"></div>   
            </div>        
        </div>
    
    </div> <!-- end of templatemo_wrapper -->
</div> <!-- end of templatemo_outer_wrapper -->

<?php
	include "../footer.php";
?>

</body>
</html>